#ifndef QD3DUTILSCVEXT_H
#define QD3DUTILSCVEXT_H
#include "qd3d_global.h"
#include "QD3DUtils.h"
#include <opencv/cv.h>


class QD3D_EXPORT QD3DUtilsCvExt : public QD3DUtils
{
public:
	QD3DUtilsCvExt ();
	QD3DUtilsCvExt (QD3DContext *pContext);
	~QD3DUtilsCvExt ();

	ID3D11Texture2D *createTexture2DFromCvImage (IplImage *pImage,
			UINT bindFlag);
	void updateTexture2DFromCvImage (ID3D11Texture2D *pDstDxTex,
			IplImage *pImage);
	void downloadCvImageFromTexture2D (ID3D11Texture2D *p_dxTex,
			IplImage *p_image);
	void getRenderTexture (IplImage *p_image);
private:
	
	bool _getDxTexDataFromCvImage (IplImage *pImage, uchar **ppOutTexData,
			UINT *pOutLineBytes, DXGI_FORMAT *pOutFormat);
};

#endif // QD3DUTILSCVEXT_H
